Skip to content

Spec cleanup: Teredo, record sizes, and deprecated types#220

Merged
horgh merged 10 commits intomainfrom
greg/eng-4268
Feb 24, 2026
Merged

Spec cleanup: Teredo, record sizes, and deprecated types#220
horgh merged 10 commits intomainfrom
greg/eng-4268

Conversation

@oschwald
Copy link
Member

Summary

  • Clarify Teredo limitation: Explain why a tree alias can't resolve Teredo client IPv4 addresses — the client IP is in bits 96-127, XOR'd with 0xFFFFFFFF, and separated from the prefix by 64 bits of unrelated data. Add RFC 4380 reference.
  • Clarify record size range: Replace misleading "24 to 128 bits" with precise constraints (multiple of 4, at least 24 bits). Note all existing databases use 24, 28, or 32. Drop redundant parenthetical from the Search Lookup Algorithm section.
  • Deprecate types 12 and 13: Mark data cache container (type 12) and end marker (type 13) as deprecated. Neither has ever been produced by any writer or appeared in any known database. Preserve historical context explaining original intent.

Also includes earlier editorial fixes: IPv4-in-IPv6 tree storage clarification, typo/grammar fixes, "hash" → "map" terminology, ASCII/binary label removal, and payload size phrasing.

Test plan

  • precious lint --all passes after each commit
  • Visual review of rendered markdown

🤖 Generated with Claude Code

The previous wording ("stored as-is ... first 32-bits of the address
space") was ambiguous and led implementers to incorrectly place IPv4
bytes in the most significant bits of the 128-bit address. Rewrite to
explicitly state that IPv4 bytes go in the least significant 32 bits,
and describe the tree traversal implications.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gemini-code-assist
Copy link

Summary of Changes

Hello @oschwald, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the clarity and accuracy of the MaxMind DB specification by providing more precise details on how various IP address types are handled within the database structure. It refines the definition of record sizes, formally deprecates unused data types, and includes several editorial improvements. The changes aim to improve understanding for implementers and maintainers of the specification.

Highlights

  • Teredo Limitation Clarified: A detailed explanation was added for why Teredo client IPv4 addresses cannot be resolved via tree aliases, including the bit-level structure and a reference to RFC 4380.
  • Record Size Specification Refined: The description of record sizes was updated to specify that they must be a multiple of 4 and at least 24 bits, replacing a less precise range and noting common existing sizes.
  • Deprecated Data Types: Data cache container (type 12) and end marker (type 13) were officially marked as deprecated, with historical context provided for their original, now obsolete, intent.
  • IPv4-in-IPv6 Tree Storage Clarification: The specification now more clearly explains how IPv4 addresses are stored within an IPv6 tree, detailing their placement in the least significant 32 bits and the implications for search tree traversal.
  • Editorial and Terminology Updates: Numerous minor fixes were applied, including grammar corrections, changing "hash" to "map" for consistency, and simplifying payload size phrasing.
Changelog
  • MaxMind-DB-spec.md
    • Clarified the Teredo subnet limitation and provided an RFC 4380 reference.
    • Updated the record size definition to be more precise (multiple of 4, at least 24 bits) and removed misleading ranges.
    • Deprecated data cache container (type 12) and end marker (type 13) with explanations for their obsolescence.
    • Expanded the explanation of IPv4 address storage within an IPv6 tree, detailing bit placement and traversal requirements.
    • Performed various editorial fixes, including grammar corrections, changing "hash" to "map" terminology, and simplifying payload size phrasing.
Activity
  • No specific activity (comments, reviews, etc.) was provided in the context.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a set of clarifications and cleanups to the MaxMind DB file format specification. The changes address several areas: the handling of Teredo subnets is explained in greater detail, the constraints on record sizes are defined more precisely, and the unused data types 12 (data cache container) and 13 (end marker) are formally deprecated while preserving historical context. The pull request also includes various editorial improvements, such as clarifying how IPv4 addresses are represented in IPv6 trees and fixing minor grammatical errors and inconsistencies. The changes improve the overall clarity and accuracy of the specification. I have reviewed the modifications and have not identified any issues.

oschwald and others added 9 commits February 24, 2026 12:25
- Add missing "is" in bytes data type description
- Add missing "that" in 28-bit node layout note
- Change "comprised of" to "composed of" in overview

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The data type is called "map" everywhere else in the spec. This was
leftover terminology.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
These labels were trying to distinguish inline types (1-7) from extended
types (8+), but both are binary encodings. The distinction is already
explained in the surrounding text.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Simplify "the next byte after the type specifying bytes as an unsigned
integer" to "the next byte (as an unsigned integer)" in all three size
extension descriptions. The phrase "after the type specifying bytes" is
unnecessary since the description already establishes sequential reading.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Explain why a tree alias cannot resolve Teredo client IPv4 addresses:
the client IP is in bits 96-127, XOR'd with 0xFFFFFFFF, and separated
from the Teredo prefix by 64 bits of unrelated data. A tree alias can
only map bits immediately following the aliased prefix.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace the misleading "24 to 128 bits" range with precise constraints:
record size must be a multiple of 4, at least 24 bits. Note that all
existing databases use 24, 28, or 32 bits while the format supports
larger sizes. Drop the redundant "(24, 28, or 32)" parenthetical from
the Search Lookup Algorithm section.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Neither type has ever been produced by any writer or appeared in any
known database. Type 12 (data cache container) is superseded by pointer-
based deduplication. Type 13 (end marker) is superseded by metadata-
based section boundary calculation. Mark both as deprecated and explain
their original intent.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Wraps markdown prose at 80 characters using prettier's --prose-wrap
always option.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Wrap prose at 80 characters using prettier --prose-wrap always,
matching the new prettier-markdown command in .precious.toml.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@horgh horgh merged commit 327e23a into main Feb 24, 2026
12 checks passed
@horgh horgh deleted the greg/eng-4268 branch February 24, 2026 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants